Urthman's MDB Construction Kit.
ASCII File Headers and Trailers

What are headers and trailers, and when, if at all, should they be used.


Comma Delimited Files  
Fixed Record Length Files Main Document

Comma Delimited File formats:

In comma-delimited files, the header record contains the column headings for the data records that follow that header record. Generally, this file format is used to transfer files from one database or spreadsheet program to another without having to be too concerned about the sender and recipient having the same spread sheet or database program. The header information is used as column headings in a users spread sheet program, and to inform the software importing the data, where each element in each data record should go.

The code generated by the Urthman's MDB Construction Kit for exporting comma delimited files includes an option to write a header record containing the data field names. The code generated for importing comma delimited formats uses the header record to align the columns of data with the appropriate corresponding fields of the database table into which the data is being imported. This permits the following scenario:

  1. The software exports selected data records from a data base to a CSV file with headers.
  2. A user imports this data into a spreadsheet, and reorganizes the columns to suit his or her needs.
  3. The user makes some minor edits to some of the data and exports this to a comma delimited file.
  4. The software imports the data, and the minor edits become written into the database.

The most significant part is that the data is imported into the correct data fields despite the fact that the columns have been moved around, and some columns may have been deleted. Columns that have been removed will result in null or default data in the record.


Fixed Length Record formats:

Schematic

The fixed record length file format is the predominant practice found in the exchange of data within the telecommunications, insurance and banking industries. Often, file and batch headers and trailers are used for organizing the data within the files.

In fixed length record formats, header and trailer records are used for grouping detail records by a type or category The header record contains some common data element(s) shared by the enclosed detail records, while the trailer record might repeat the same data elements as the header, and also contain some summary data used to validate the integrity of the enclosed data.

Fixed length record formatted files can include both a file header and trailer, as well as batch header and trailer groups. This is generally a practice used where multiple companies are sending or receiving data files between each other. The file header might contain data that identifies who the sending and receiving companies are, and the trailer record might contain a summary of the enclosed batches.

FILE HEADER RECORD
BATCH HEADER RECORD
DATA DETAIL RECORD

DATA DETAIL RECORD

DATA DETAIL RECORD

BATCH TRAILER RECORD

BATCH HEADER RECORD
DATA DETAIL RECORD

DATA DETAIL RECORD

DATA DETAIL RECORD

BATCH TRAILER RECORD

FILE TRAILER RECORD

The Urthman's MDB Construction Kit allows you, the programmer, to select header and trailer record layouts for any given table, and to define up to three elements for each of the headers and trailers as recognition codes. While importing data, the incoming record is tested for these recognition elements, and when encountered, the header or trailer record is broken out into it's component parts as needed. Also, during this import function, a variable (RecType) is set to indicate the record that had just been imported.

The Construction Kit also sets up the subroutines necessary for exporting these same headers and trailers. Please note that the same elements used to identify these records are included in the generated code, where the values of these elements are set just before writing the record to the file.


Contact: John Stanley Enterprises
PO Box 1672
Valrico, FL 33595-1672
URL: http://www.a-znet.com/jse/
Email: urthman@usa.net
  Microsoft, Windows, NT and Visual Basic are registered trademarks of the Microsoft Corporation.